package database;

import java.util.ArrayList;

public class Database {
//    private ArrayList<CD> listCD = new ArrayList<CD>();
//    private ArrayList<DVD> listDVD = new ArrayList<DVD>();
    private ArrayList<Item> items = new ArrayList<>();

    public void add(Item item) {
        items.add(item);
    }
    public void list() {
        for (Item item : items) {
            item.print();
            System.out.println();
        }
    }

    public static void main(String[] args) {
//        Item item = new Item("aaa",1, true, "aaa");
//        CD cd = new CD("bbb","bbb",1, 1, true, "bbb");
//        item = cd;
//        CD cc = (CD) item;
//
//        CD cd1 = new CD("bbb","bbb",1, 1, true, "bbb");
//        CD cd2 = new CD("bbb","bbb",1, 1, true, "bbb");
//
//        System.out.println(cd1.equals(cd2));

        Database db = new Database();
        db.add(new CD("Hello", "Hello", 1, 1, true, "Hello"));
        db.add(new DVD("Hi","aaa",1,"Hi"));
        db.add(new VideoGame("Hi",1,true,"Hi",2));

        db.list();
    }
}
